/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package se.kth.lwr.jeat.samples.onsitetreatment;

import java.lang.reflect.InvocationTargetException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.measure.quantity.Mass;
import javax.measure.quantity.Quantity;
import javax.measure.quantity.VolumetricDensity;
import javax.measure.unit.BaseUnit;
import javax.measure.unit.NonSI;
import javax.measure.unit.ProductUnit;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import org.jscience.physics.amount.Amount;
import se.kth.lwr.jeat.core.DefaultUnitHandler;
import se.kth.lwr.jeat.core.EutroficationModel;
import se.kth.lwr.jeat.core.GlobalWarmingModel;
import se.kth.lwr.jeat.core.Report;
import se.kth.lwr.jeat.explorer.JeatExplorer;

/**
 *
 * @author davidev
 */
public class Main {

    public Main() {
   
        
                
        //Tweak the DefaultUnitHandler to custom prefered units for the reporter
        DefaultUnitHandler handler = (DefaultUnitHandler) Report.getUnitHandler();
        handler.addPreferedUnit(SI.MEGA(SI.JOULE).divide(NonSI.YEAR).divide(Units.PersonEquivalent));
        handler.addPreferedUnit(SI.KILOGRAM.times(Units.PO4Eqvivalent).divide(NonSI.YEAR).divide(Units.PersonEquivalent));
        handler.addPreferedUnit(SI.KILOGRAM.times(Units.CO2Eqvivalent).divide(NonSI.YEAR).divide(Units.PersonEquivalent));
        //get an instance of Scenario 1 (includes the complete system analyse model)
        Scenario1 scenario1 = new Scenario1("Scenario 1 - Bed filter", "LCA model for simple bed filter system");

        //Start the explorer...
        try {
            JeatExplorer explorer = new JeatExplorer();
            //attach the model
            explorer.attachModel(scenario1);
            //set the Impact models of interesst
            explorer.useImpactModel(new EutroficationModel());
            explorer.useImpactModel(GlobalWarmingModel.get100yearsHorizonModel());
            //Start the GUI
            explorer.visualize();
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        } catch (InvocationTargetException ex) {
            ex.printStackTrace();
        }


    }

    public static void main(String[] args) {
        new Main();

    }
}
